const webpack = require('webpack');
const { rootResolve, distResolve } = require('./unit.js');
const htmlWebpackPlugin = require('html-webpack-plugin');

module.exports = {
  mode: "development",
  entry: './src/app.js',
  output: {
    filename: '[name].[hash:8].js',
    path: distResolve(),
    publicPath: '/'
  },
  resolve: {
    extensions: ['.js', '.json'],
    alias: {
      '@': rootResolve('src'),
    }
  },
  plugins: [
    new htmlWebpackPlugin({
      template: "index.html",
      filename: "index.html"
    })
  ]
};